package com.cloud;

import lombok.extern.slf4j.Slf4j;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.context.ConfigurableApplicationContext;

import javax.security.auth.login.Configuration;
import java.util.concurrent.TimeUnit;

@SpringBootApplication
@MapperScan(basePackages = {"com.cloud.mapper"})
@EnableFeignClients
@Slf4j
public class CloudConsumerApplication {

    public static void main(String[] args) throws InterruptedException {
        ConfigurableApplicationContext applicationContext =
                SpringApplication.run(CloudConsumerApplication.class, args);
            String name = applicationContext.getEnvironment().getProperty("user.name");
            String name2 = applicationContext.getEnvironment().getProperty("user.config");
            System.err.println("user name :" + name + "; age: " + name2);
            TimeUnit.SECONDS.sleep(1);
        log.info("Consumer服务已启动 端口:{}",applicationContext.getEnvironment().getProperty("server.port"));

    }

}
